﻿using System;
using UnityEngine;

namespace HurricanePackage
{
    public class UIRootWnd : UGUILoadWnd<UIRootConfig>
    {
        public UiRootType get => View.RootType;
        private bool m_needDestroy;

        public UIRootWnd(LocalResAssetObject _assetObj,Action _loadAct = null,bool _needDestroy = true) : base(_assetObj)
        {
            Load(_loadAct);
        }

        public Transform GetParentTransform(UiLayoutType _t)
        {
            return View.GetLayout(_t);
        }

        protected override Transform ParentTransform
        {
            get => null;
        }
        protected override void _OnInitDone()
        {
            if(!m_needDestroy)
                GameObject.DontDestroyOnLoad(GameObj);
        }

        protected override void _OnShow()
        {
            
        }

        protected override void _OnHide()
        {
           
        }

        protected override void _OnReset()
        {
           
        }

        protected override void _OnDiscord()
        {
           
        }
    }
}